<?php

/*
Penny Store Logs (admin_penny_logs.php)
*/

$page_title = "Penny Store Logs";
$rank_check = 7;
include "../header.inc.php";

print "$openHTML";

ECHO <<<END

<P align=center><TABLE BGCOLOR="$tableOutline" CELLSPACING=1 CELLPADDING=0 WIDTH=450>
   <TR BGCOLOR="$topAndBottomBG">
      <TD COLSPAN=3 HEIGHT=45>
         <CENTER><FONT SIZE="+3" COLOR="$topAndBottomText"><B>--Penny Store Logs--</B></FONT></CENTER>
      </TD>
   </TR>
   <TR BGCOLOR="$maincellColor">
      <TD>
         <CENTER>Item Name</CENTER>
      </TD>
      <TD>
         <CENTER>Bought By</CENTER>
      </TD>
   </TR>
END;

$findLogs = mysql_query("SELECT * FROM sales_logs2 WHERE bought_from = 'Penny Store $game' AND game = '$game' ORDER BY id DESC limit 500");
while ($getLogs = mysql_fetch_array($findLogs))
{
	$findItem = fetch("SELECT item_name FROM items2 WHERE id = '$getLogs[bought_item]' AND game = '$game'");
	$findBuyer = fetch("SELECT display_name FROM members2 WHERE id = '$getLogs[bought_by]' AND game = '$game'");
	$cellcolor = alternate($cellcolor,"$reallyLight","#FFFFFF");
	
	print "   <TR BGCOLOR=\"$cellcolor\"> <TD> <CENTER>$findItem[item_name]</CENTER> </TD> <TD>
	<CENTER>$findBuyer[display_name]</CENTER> </TD></TR>
	";
}


print "</TABLE></P>";

print "<p align=center><a href=admin_penny_logs.pro.php?game=$game>Delete Sales Log</a></p>";

print "$closeHTML";
?>
